package com.xinqi.modules.exam.student.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.xinqi.common.base.enums.BaseEnum;
import lombok.Getter;

/**
 * 学生试卷状态，0-未交卷；1-未批阅；2-被打回；4-已批阅；
 *
 * @author linkai
 * @date 2023/7/2
 */
public enum PaperAnswerStatusEnum implements BaseEnum {
    未交卷("0", "未交卷"),
    未批阅("1", "未批阅"),
    被打回("2", "被打回"),
    已批阅("4", "已批阅"),
    ;

    @Getter(onMethod_ = {@JsonValue})
    private final String code;

    @Getter
    private final String describe;

    PaperAnswerStatusEnum(String code, String describe) {
        this.code = code;
        this.describe = describe;
    }

    @JsonCreator
    public static PaperAnswerStatusEnum of(String code) {
        return BaseEnum.of(PaperAnswerStatusEnum.class, code);
    }
}
